package com.leyou.item.mapper;

import com.leyou.dto.BrandDTO;
import com.leyou.item.pojo.Brand;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface BrandMapper extends Mapper<Brand> {

    int insertCategoryBrand(@Param("bid") Long bid,@Param("cids") List<Long> cids);

    void deleteCategoryBrand(Long bid);

    @Select("SELECT b.* FROM tb_category_brand cb,tb_brand b  WHERE cb.category_id = #{id} AND cb.brand_id = b.id")
    List<BrandDTO> findBrandsById(Long id);
}